package com.xgry.bpm.api.base.testTable.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xgry.bpm.api.base.testTable.entity.TestTable;
import com.xgry.bpm.api.base.testTable.mapper.TestTableMapper;
import com.xgry.bpm.api.base.testTable.service.TestTableService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xgry.bpm.config.datasouce.Master;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author adrian
 * @since 2020-07-02
 */
@Service
public class TestTableServiceImpl extends ServiceImpl<TestTableMapper, TestTable> implements TestTableService {


    @Override
    public List<TestTable> getTestTableList() {
        return baseMapper.selectList(new QueryWrapper<>());
    }

    @Master
    @Override
    public List<TestTable> getTestTableList(Integer id) {
        return baseMapper.selectList(new QueryWrapper<TestTable>(){{
            this.eq("id",id);
        }});
    }

    @Override
    public int insertTable(TestTable testTable) {
        return baseMapper.insert(testTable);
    }

    @Override
    public List<TestTable> getTestTableByXml() {
        return baseMapper.getTestTableByXml();
    }

    @Override
    public IPage<TestTable> getTableForPage(Page<TestTable> page, TestTable testTable) {
        return baseMapper.getTableForPage(page,testTable);
    }


}
